#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main()
{
    ll n, a, b, ans = 0;
    int t;
    cin >> t;
    while (t--)
    {
        cin >> n >> a >> b;
        if (n <= 2)
        {
            ans = min(a, b);
        }
        else if (a / 2 <= b / 3)
        {
            ans = n / 2 * a;
            n %= 2;
            if (n) ans += min(min(a, b), b - a);
        }
        else
        {
            ans = n / 3 * b;
            n %= 3;
            if (n == 1) ans += min(min(a, b), 2 * a - b);
            else if (n == 2) ans += min(min(a, b), 3 * a - b);
        }

        cout << ans << endl;
    }
    return 0;
}